﻿@model DCH.Areas.Admin.Models.Tournament

@{
    ViewBag.Title = "Create";
}
<style>
    #Venue {
        width:400px;
    }
</style>
<h2>Create Tournament Matches</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Tournament</legend>

        <div class="editor-label">
            @Html.Label("T1 Name") 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.team1_name)
            @Html.ValidationMessageFor(model => model.team1_name)
        </div>

        <div class="editor-label">
           @Html.Label("T1 Score") 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.team1_score)
            @Html.ValidationMessageFor(model => model.team1_score)
        </div>

        <div class="editor-label">
            @Html.Label("T1 Score Card") 
        </div>
        <div class="editor-field">
           
             @Html.TextAreaFor(model => model.team1_score_card, new { @class="ckeditor", @id="team1_score_card"})
            @Html.ValidationMessageFor(model => model.team1_score_card)
        </div>

        <div class="editor-label">
            @Html.Label("T2 Name") 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.team2_name, new { @value = "rishi" })
            @Html.ValidationMessageFor(model => model.team2_name)
        </div>

        <div class="editor-label">
           @Html.Label("T2 Score") 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.team2_score)
            @Html.ValidationMessageFor(model => model.team2_score)
        </div>

        <div class="editor-label">
             @Html.Label("T2 Score Card") 
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.team2_score_card, new { @class="ckeditor", @id="team2_score_card", @value = ViewBag.ScoreCard2 })
            
            @Html.ValidationMessageFor(model => model.team2_score_card)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Winner)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Winner)
            @Html.ValidationMessageFor(model => model.Winner)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Date)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Date) 
            @Html.ValidationMessageFor(model => model.Date )
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Venue)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Venue, new { size = 200 })
            @Html.ValidationMessageFor(model => model.Venue)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Highlight)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Highlight, new { @class="ckeditor", @id="Highlight"})
            @Html.ValidationMessageFor(model => model.Highlight)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
<script>

    var editor = CKEDITOR.instances["editor1"];
    if (editor) { editor.distroy(true); }
    CKEDITOR.replace("team1_score_card", {
        enderMode: CKEDITOR.ENTER_BR,
    });
    CKEDITOR.replace("team2_score_card", {
        enderMode: CKEDITOR.ENTER_BR,
    });
    CKEDITOR.replace("Highlight", {
        enderMode: CKEDITOR.ENTER_BR,
    });

    CKFinder.setupCKEditor(null, '@Url.Content("~/ckfinder/")')
    
</script>

